import java.io.File;
import java.io.IOException;

public class NewFile {
    public static void main(String[] args) {
        File file = new File("test.txt");
        try {
            // 存在则不在创建
            System.out.println(file.createNewFile());;
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
